/**
 * Created on Mar 04, 2010
 *
 * Copyright (c) 2010, The MAGI Project.
 * All rights reserved.
 *
 * This software is open-source under the GNU General Public License v3;
  */

package org.braincore.common;

/**
 * Neuron data class.
 * @author Carlos Giraldo carlgira@gmail.com
 */
public class Neuron
{
    /**
     * Neuron identifier, integer of 6 digits.
     */
    private Integer _id;

    /**
     * Neuron type, integer of 3 digits.
     */
    private Integer _typeNeuron;

    /**
     * Memory type, integer of 2 digits.
     */
    private Integer _typeMemory;

    /**
     * Masive, if the neuron is masive or not. (Masive means that neuron gots to many conecctions)
     */
    private Boolean _masive;

    /**
     * The data conteined by the neuron.
     */
    private BrainData _data;

    public Neuron(Integer _id, Integer _typeNeuron, Integer _typeMemory, Boolean _masive) {
        this._id = _id;
        this._typeNeuron = _typeNeuron;
        this._typeMemory = _typeMemory;
        this._masive = _masive;
    }

    public Neuron(Integer _id, Integer _typeNeuron, Integer _typeMemory, Boolean _masive, BrainData _data) {
        this._id = _id;
        this._typeNeuron = _typeNeuron;
        this._typeMemory = _typeMemory;
        this._masive = _masive;
        this._data = _data;
    }

    public BrainData getData() {
        return _data;
    }

    public void setData(BrainData _data) {
        this._data = _data;
    }

    public Integer getId() {
        return _id;
    }

    public void setId(Integer _id) {
        this._id = _id;
    }

    public Boolean getMasive() {
        return _masive;
    }

    public void setMasive(Boolean _masive) {
        this._masive = _masive;
    }
    
    public Integer getTypeMemory() {
        return _typeMemory;
    }

    public void setTypeMemory(Integer _typeMemory) {
        this._typeMemory = _typeMemory;
    }

    public Integer getTypeNeuron() {
        return _typeNeuron;
    }

    public void setTypeNeuron(Integer _typeNeuron) {
        this._typeNeuron = _typeNeuron;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Neuron other = (Neuron) obj;
        if (this._data != other._data && (this._data == null || !this._data.equals(other._data))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 41 * hash + (this._id != null ? this._id.hashCode() : 0);
        hash = 41 * hash + (this._typeNeuron != null ? this._typeNeuron.hashCode() : 0);
        hash = 41 * hash + (this._typeMemory != null ? this._typeMemory.hashCode() : 0);
        hash = 41 * hash + (this._masive != null ? this._masive.hashCode() : 0);
        return hash;
    }
}
